package edu.gdkm.demo;

public class TeacherTest {
    public static void main(String[] args) {
        int i = 1;
       //对象，左边定义类型，右边初始化该对象
        Teacher t1 = new Teacher("100001","张三","男",3000,250);
        t1.print();
        System.out.println(t1.total());
        Teacher t2 = new Teacher("100002","李四","男");
        t2.print();
        System.out.println(t2.total());

        Teacher t3=new Teacher();
        t3.setTeacherId("10003");
        t3.setName("王五");
        t3.setSex("男");
        t3.setSalary(4000);
        t3.setWage(800);
        Teacher t4=t3; //引用传递，即t3和t4 指向同一个内存地址存储的对象
        System.out.println(t1);
        System.out.println(t2);
        System.out.println(t3);
        System.out.println(t4);

        System.out.println(t3.getSalary());
        System.out.println(t4.getSalary());
        t3.setSalary(4500);   //对t3的属性值进行修改，输出t4的属性也一样是修改后的值
        System.out.println(t3.getSalary());
        System.out.println(t4.getSalary());
    }
}
